package com.sdgakj.dto.base;

import java.io.Serializable;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.data.domain.Page;

public class ResPageResult  extends ResResult implements Serializable {
	
	private static final long serialVersionUID = 2003013299091952380L;
	
	public long totalNumber;
	public int totalPages;
	
	public ResPageResult() {
		super();
	}
		
	public long getTotalNumber() {
		return totalNumber;
	}
	public void setTotalNumber(long totalNumber) {
		this.totalNumber = totalNumber;
	}
	public int getTotalPages() {
		return totalPages;
	}
	public void setTotalPages(int totalPages) {
		this.totalPages = totalPages;
	}
	
	/**
	 * 设置page对象
	 * 
	 * @param obj
	 */
	public void setPageObj(Page obj) {
		this.setData(obj.getContent());
		this.setTotalNumber(obj.getTotalElements());
		this.setTotalPages(obj.getTotalPages());
	}
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
